<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>公告中心</title>
    <link rel="stylesheet" href="css/notice.css">
    <script src="js/jquery-1.10.1.min.js"></script>
</head>
<body>
<div class="title">
    <i class="iconfont">&#xe613;</i>
    <p>公告中心</p>
</div>
<div class="details">

</div>
</body>
<script type="text/javascript">

    window.onload = function () {
        $(".iconfont").click(function () {
            console.log(localStorage.uid);
            if(localStorage.uid ===0){
                window.location.href="index.html";
            }else {
                window.location.href="notice.html";
            }
        });
        $(function(){
            $.ajax({
                url: `${localStorage.top}api/index/notice_detail?TOKEN=${localStorage.token}`,    //请求的url地址
                dataType: "json",   //返回格式为json
                async: true,//请求是否异步，默认为异步，这也是ajax重要特性
                type: "GET",   //请求方式
                data:{article_id:localStorage.id},
                success: function (data) {

                    // $(".title p").html(data.data.title);
                    $(".details").html(data.data.content);

                }
            })

        });
    };

</script>
</html>